The present invention relates to a method for controlling a disk drive, and more particularly to a method for controlling a disk drive that is resistant to failure.
The conventional disk drive (hereinafter referred to as HDD) converts a logical block address specified by a host into a physical block address that is unique in the HDD, and thereby accesses a storage medium in the HDD. Usually, the address conversion is performed by use of a conversion formula in which the number of cylinders of the HDD, the number of heads of the HDD, the number of sectors per track, and the like, are used as parameters. Accordingly, even if the HDD is equipped with a low performance processor and a small-capacity memory, the HDD can convert a logical block address into a physical block address or vice versa at sufficiently high speed. However, the address conversion performed by use of such a conversion formula results in a one-to-one correspondence between a logical block address and a physical block address. This means that writing to one and the same logical block address erases the contents written therein before.
Such operation usually produces no problem. However, if an operation error or a computer virus causes data that must not be deleted to be overwritten, data in the HDD is lost. If the data is not backed up to an external HDD, the data is lost forever. This occurs because even if a command is illegal judging from the intention of a user, when the command is acceptable as a command identified by the HDD, the HDD executes the command without recognizing the intention of the user.
As far as large-size disk array devices are concerned, a method for assigning a storage area on a storage device, which is different from the address conversion by use of the conversion formula as described above, is proposed. In the U.S. Pat. No. 4,467,421 “VIRTUAL STORAGE SYSTEM AND METHOD”, every time a write request is received from a host, a required area is reserved from a plurality of storage devices, and then data is written. As a result, even if a usual block device command is used, it is possible to write data to a new area without erasing an existing area.
In the RAID level 4 or 5 of the RAID system (D. A. Patterson, G. A. Gibson, R. H. Katz, “A Case for Redundant Arrays of Inexpensive Disks (RAID)”, Proceedings of the international Conference on Management of Data (SIGMOD), June 1988, PP. 109-116) proposed by Patterson, and others, at every write a parity is read out and updated before the parity is written back. As a result, a write penalty occurs, which produces a problem of the decrease in write performance. As a solution to cope with this problem, U.S. Pat. No. 5,124,987 “LOGICAL TRACK WRITE SCHEDULING SYSTEM FOR A PARALLEL DISK DRIVE ARRAY DATA STORAGE SUBSYSTEM” proposes that newly written data and parity data generated on the fly are written in an area in a new storage device.
U.S. Pat. Nos. 4,467,421 and 5,124,987 require a mapping table for managing the correspondence between a logical block address specified by a host and a physical block device in a storage device. Even if a failure does not occur in the storage device, when a failure occurs in the mapping table, data in the storage device cannot be accessed. Since the mapping table requires high reliability, even if a failure occurs in the mapping table due to some accident, it is necessary to rebuild the mapping table. As a solution to this problem, there is proposed “Information storage device, and management data rebuilding method applied to the information storage device” described in Japanese Patent Laid-open No. 11-85589.
Japanese Patent Laid-open No. 11-85589 proposes the following mapping table rebuilding method: saving a value of a logical block address specified by a host in an user data storage area; and in the event that a failure occurs in the mapping table, rebuilding a mapping table by reading out values of all logical block addresses written to the user data storage area. In addition to it, Japanese Patent Laid-open No. 11-85589 also proposes the following method: if a write has been made to the same logical block address more than once, generating a sequence number indicating the order of writes; saving this sequence number in the user data storage area together with the value of the logical block address; and in the event that a failure occurs in the mapping table, determining the latest write from the sequence number saved in the user data storage area.
U.S. Pat. Nos. 4,467,421 and 5,124,987 disclose techniques in which a new area is allocated in the storage subsystem that looks like a simple block device from the host. Another method is the Log-Structured File System proposed by Rosenblum, and others (M. Rosenblum, and J. K. Ousterhout, “The Design and Implementation of a Log-Structured File System”, ACM Transactions on Computer System, Vol. 10, No. 1, February 1992, pp. 3-25). In the Log-Structured File System (hereinafter referred to as LFS), blocks are allocated in a manner that appending is performed for a usual block device at a file system level. As compared with the speedup of processors and semiconductor memories, the speedup of HDDs does not progress. The LFS is one of techniques originally devised as a solution to the speedup of HDDs. In a usual file system, at the time of writing to a HDD, a period of time which is allowed to be used for data transfer from a host to the HDD is reduced by seek time of a head. As opposed to this, in the LFS, all processing for the file system including meta information, which is management information of the file system for managing file deletion, and the like, is appended to the HDD as a log. This reduces the head seek time at the time of writing, and sequential writes achieve the speedup of writing.